# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-prettytable
_pkgname=prettytable
pkgver=0.7.2
pkgrel=13
pkgdesc='A simple Python library for easily displaying tabular data in a visually appealing ASCII table format.'
url='https://pypi.org/project/prettytable/#files'
arch=('any')
license=('BSD')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.bz2")
sha512sums=('f3a3fe6fa29f4ef090ff6cac06549ebd9db8b387e7b25fc64c4e37c8444586f50355c5573f38caabc72360aa68054aa189a67aa37f0bd13b872862ecd9151e71')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  chmod 644 \
    "$pkgdir/usr/lib/python2.7/site-packages/prettytable-0.7.2-py2.7.egg-info/"*
}
